#include "Connection.h"

Connection::Connection(EventLoop *loop, Sock *clentSock)
:loop_(loop),clientSock_(clentSock)
{
    clientChannel_ = new Channel(loop_, clentSock->getSock());
    clientChannel_->setReadCallBack(std::bind(&Channel::onmessage, clientChannel_));
    clientChannel_->useET();
    clientChannel_->enableReading();
}
Connection::~Connection()
{
    delete clientSock_;
    delete clientChannel_;
}